//
//  XYJXCCollectionViewCell.m
//  徙游记-01
//
//  Created by hcios on 2017/7/10.
//  Copyright © 2017年 鹿林. All rights reserved.
//

#import "XYJXCCollectionViewCell.h"
#import "UIImageView+WebCache.h"

@implementation XYJXCCollectionViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
   
    [self setupSubViews];
}


-(void)setupSubViews{
    
    self.layer.cornerRadius = 4;
    self.layer.masksToBounds = YES;
    self.backgroundColor = [UIColor whiteColor];
    
    _bgImageView.layer.cornerRadius = 4;
    _bgImageView.layer.masksToBounds = YES;
    
    [_nameLab setFont:[UIFont fontWithName:FONT_NAME_LTH size:18]];
    [_nameLab setTextColor:[UIColor whiteColor]];
    _nameLab.shadowColor = [UIColor blackColor];
    _nameLab.shadowOffset = CGSizeMake(1, 1);
    
    [_daysLab setTextColor:[UIColor whiteColor]];
    [_daysLab setFont:[UIFont fontWithName:FONT_NAME_LTH size:16]];
    _daysLab.shadowOffset = CGSizeMake(1, 1);
    _daysLab.shadowColor = [UIColor blackColor];
    
    
    _textLab.numberOfLines = 0;
    [_textLab setFont:[UIFont fontWithName:FONT_NAME_LTH size:13]];
    [_textLab setTextColor:[UIColor blackColor]];
    
   
}

-(void)setModel:(XYJXCModel *)model{
    _model = model;
    
    [_bgImageView sd_setImageWithURL:[NSURL URLWithString:model.xc_image_url] placeholderImage:[UIImage imageNamed:@"zhanWeiTu"]];
    _nameLab.text = model.xc_name;
    _daysLab.text = [NSString stringWithFormat:@"%@天/%@个旅行地",model.xc_plan_days_count,model.xc_plan_nodes_count];
    _textLab.text = model.xc_description;
}

@end
